package com.yonyou.iuap.shell.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.yonyou.iuap.base.dao.IKmBaseDao;
import com.yonyou.iuap.persistence.mybatis.anotation.MyBatisRepository;
import com.yonyou.iuap.shell.entity.BdCategoryRelationEntity;
import com.yonyou.iuap.shell.entity.BdKnowledgeCategoryEntity;
import com.yonyou.iuap.shell.entity.exp.BdKnowledgeCategoryEntityVo;


/**
 * 
 * BdKnowledgeCategoryEntityDao数据库操作接口类
 * 
 **/
@MyBatisRepository
@Repository(value="Dao-BdKnowledgeCategoryEntityDao")
public interface BdKnowledgeCategoryEntityDao<T> extends IKmBaseDao<T>{
	
	//查询当前节点是否有子节点
	int selectById(String knowledgeCategory);

	int selectByTypeId(String knowledgeCategory);
	//查询当前列别下的code为最大的子类别
	String selectKnowledgeCategoryCode(String fw_parent);

	int insertCategory(BdKnowledgeCategoryEntityVo supplier);

	int insertRelation(BdCategoryRelationEntity relation);
	//查询所有
	List<BdKnowledgeCategoryEntityVo> selectAllNew();
	
	//查询当前父类下的所有子节点
	List<BdKnowledgeCategoryEntity> getCategoryParentName(String fw_parent);

	int updateCategory(BdKnowledgeCategoryEntityVo supplier);

	int updateRelation(BdCategoryRelationEntity relation);

	List<BdKnowledgeCategoryEntityVo> getAllKnowledgeCategoryRelation(
			String pk_knowledge_category);
	
	/**
	 * 根据类别id 删除 关系表数据
	 * @param pk_knowledge_category
	 */
	int deleteByCategoryId(String pk_knowledge_category);
	
	List<BdKnowledgeCategoryEntityVo> selectUserRole(Map map);


}